package com.article.controller;

import com.article.entity.ApiResult;
import com.article.entity.model.ArticleContent;
import com.article.service.ArticleContentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "文章内容接口")
@RequestMapping("/articleContent")
public class ArticleContentController {

    @Autowired
    private ArticleContentService articleContentService;

    @ApiOperation(value = "添加文章内容", notes = "添加文章内容")
    @RequestMapping(value = "/addArticleContent")
    public ApiResult addArticleContent(@RequestBody ArticleContent param){
        ApiResult apiResult = articleContentService.addArticleContent(param);
        return apiResult;
    }

    @ApiOperation(value = "删除文章内容(主键)", notes = "删除文章内容(主键)")
    @RequestMapping(value = "/deleteArticleContentById")
    public ApiResult deleteArticleContentById(@RequestBody ArticleContent param){
        ApiResult apiResult = articleContentService.deleteArticleContentById(param);
        return apiResult;
    }

    @ApiOperation(value = "更新文章内容(主键)",notes = "更新文章内容(主键)")
    @RequestMapping(value = "/updateArticleContentById")
    public ApiResult updateArticleContentById(@RequestBody ArticleContent param){
        ApiResult apiResult = articleContentService.updateArticleContentById(param);
        return apiResult;
    }
}
